<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
    <x:parse xml="${param.xmlstr}" var="xmlData" />
    <input type="hidden" name="zh_parsen/fzr_name" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>" />
    <input type="hidden" name="zh_parsen/fzr_mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>" />
    <input type="hidden" name="zh_parsen/fzr_tel" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>" />
    <input type="hidden" name="zh_parsen/fzr_email" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>" />
    <input type="hidden" name="zh_parsen/fzr_duty" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/prof_title_name"/>" />
<div class="t_bar">基本情况</div>
<table class="t_css" width="100%" id="table_01">
    <col style="width: 20%" />
    <col style="width: 23%" />
    <col style="width: 19%" />
    <col style="width: 19%" />
    <col style="width: 19%" />

    <tr>
        <td align="right"><span class="color_red">*</span>孵化器名称：</td>
        <td colspan="4">
            <input type='text' name='proposal/zh_title' id='zh_title' style="width: 90%" class=" required" maxlength="100"
                   value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="孵化器名称">
        </td>
    </tr>

    <tr>
        <td align="right">运营机构名称：</td>
        <td colspan="4">
            <span name="organizations/organization/org_name"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name" /></span>
        </td>
    </tr>

    <tr>
        <td align="right"><span class="color_red">*</span>归口管理部门：</td>
        <td>
            <c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  label="归口管理部门"
                      id="recomend_org" onlyChooseLeaf="false"  showPattern="all" shieldPattern="0" topCheckbox="true" onClick="initTreeValueExt" />
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"  class="required"  value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
            <input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
        </td>
        <td align="right" ><span class="color_red">*</span>申报日期：</td>
        <td colspan="2"><c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
            <cpt:date id="apply_date_curr"  name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期" ></cpt:date>
        </td>
    </tr>

    <tr>
        <td align="right"><span class="color_red">*</span>机构性质：</td>
        <td colspan="4" align="left">
            <c:set var="operation_subject_natures"><x:out select="$xmlData/data/proposal/operation_subject_nature_value" /></c:set>
            <cpt:checkbox key="operation_main_natures" style="float:left;" name="operation_subject_nature" width="70px" repeatColumn="4" value="${operation_subject_natures }"  tagType="radio" ></cpt:checkbox>
            <input type="hidden" id="operation_subject_nature_value" name="proposal/operation_subject_nature_value" class="required" value="${operation_subject_natures }" label="机构类型">
            <input type="hidden" id="operation_subject_nature_name" name="proposal/operation_subject_nature_name" value="<x:out select="$xmlData/data/proposal/operation_subject_nature_name" />">
            <!-- 其他的值 -->
            <input type="hidden" id="operation_subject_nature_other" name="proposal/operation_subject_nature_other" label="机构性质-->其他" value="<x:out select="$xmlData/data/proposal/operation_subject_nature_other" />"/>
            <input type="hidden" id="enterprise_type_other" name="proposal/enterprise_type_other" label="机构性质-->企业-->国有或民营" value="<x:out select="$xmlData/data/proposal/enterprise_type_other" />"/>
        </td>
    </tr>

    <tr>
         <td align="right"><span class="color_red">*</span>类型：</td>
         <td colspan="4">
             <c:set var="incubator_type"><x:out select="$xmlData/data/proposal/incubator_type_value" /></c:set>
             <cpt:checkbox key="incubator_type2"  name="incubator_type" value="${incubator_type}" width="220px;" repeatColumn="3" onClick="initControlValue(this.id);" tagType="radio" style="border: 0px; padding: 0px; margin: 0px;float:left;"></cpt:checkbox>
             <input type="hidden" id="incubator_type_value" name="proposal/incubator_type_value" class="required" value="<x:out select="$xmlData/data/proposal/incubator_type_value" />" label="类型">
             <input type="hidden" name="proposal/incubator_type_name" value="<x:out select="$xmlData/data/proposal/incubator_type_name" />">
         </td>
    </tr>

    <tr>
        <%--
        <td align="right" ><span class="color_red">*</span>机构类型：</td>
        <td>
            <input type="text" label="机构类型"  name="proposal/mechanism_type" class="required"  maxlength="30"
                value="<x:out select="$xmlData/data/proposal/mechanism_type" />">
        </td>--%>

            <td align="right">注册时间：</td>
            <td align="center">
                <span name="organizations/organization/registe_date"><x:out select="$xmlData/data/organizations/organization[@submit_org=1]/registe_date" /></span>
            </td>
        <td align="right"><span class="color_red">*</span>开始运营时间：</td>
        <td colspan="2">
            <c:set var="Begin_operation_date"><x:out select="$xmlData/data/proposal/begin_operation_date" /></c:set>
            <cpt:date id="Begin_operation_date_curr" name="proposal/begin_operation_date" value="${Begin_operation_date}"
                      className="required date " label="开始运营时间"></cpt:date>
        </td>
    </tr>

    <tr>
        <td align="right">注册资本：</td>
        <td align="center">
            <span name="organizations/organization/registe_fund"><x:out  select="$xmlData/data/org_basic_info/registe_fund"/></span>万<span name="organizations/organization/registe_fund_money_name"><x:out  select="$xmlData/data/organizations/organization[@submit_org=1]/registe_fund_money_name"/></span>
        </td>
        <td align="right"><span class="color_red">*</span>注册地址：</td>
        <td colspan="2">
            <input type="text" label="注册地址" name="proposal/registered_address" class="required"  style="width: 92%" maxlength="50"
                   value="<x:out select="$xmlData/data/proposal/registered_address" />">
        </td>
    </tr>

    <tr>
        <td align="right" rowspan="3">负责人：</td>
        <td align="right">姓名：</td>
        <td>
            <span><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/></span>
        </td>
        <td align="right">职务：</td>
        <td>
            <span><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/prof_title_name"/></span>
        </td>
    </tr>

    <tr>
        <td align="right">手机号码：</td>
        <td>
            <span><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/></span>
        </td>
        <td align="right">电子邮箱：</td>
        <td>
            <span><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/></span>
        </td>
    </tr>

    <tr>
        <td align="right">联系电话：</td>
        <td colspan="3">
            <span><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/></span>
        </td>
    </tr>

    <tr>
        <td align="right" rowspan="3"><span class="color_red">*</span>联系人：</td>
        <td align="right">姓名：</td>
        <td>
            <input type="text" class="required" maxlength="30" name="proposal/linkman/name"
                   value="<x:out select="$xmlData/data/proposal/linkman/name"/>" label="联系人->姓名">
        </td>
        <td align="right">电话：</td>
        <td>
            <input type="text" class="required"    maxlength="30" name="proposal/linkman/tel"
                   value="<x:out select="$xmlData/data/proposal/linkman/tel"/>" label="联系人->电话">
        </td>
    </tr>

    <tr>
        <td align="right">手机：</td>
        <td>
            <input type="text" name="proposal/linkman/mobile" class="required mobile" onfocus="InitInput.setNumber(this,11,0,0)" maxlength="11"
                   label="联系人->手机" value="<x:out select="$xmlData/data/proposal/linkman/mobile" />" />
        </td>
        <td align="right">邮编：</td>
        <td >
            <input type="text" name="proposal/linkman/zip_code" class="required" onfocus="InitInput.setNumber(this,6,0,0)"
                   label="联系人->邮编" value="<x:out select="$xmlData/data/proposal/linkman/zip_code" />" />
        </td>
    </tr>

    <tr>
        <td align="right">邮箱：</td>
        <td>
            <input type="text" class="required email" maxlength="30" name="proposal/linkman/email"
                   value="<x:out select="$xmlData/data/proposal/linkman/email"/>" label="联系人->邮箱">
        </td>
        <td align="right">通讯地址：</td>
        <td>
            <input type="text" class="required" maxlength="100" name="proposal/linkman/address"
                   value="<x:out select="$xmlData/data/proposal/linkman/address"/>" label="联系人->通讯地址">
        </td>
    </tr>
</table>


<table class="t_css" width="100%"  id="table_02" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;word-break: break-all">
    <col style="width: 20%" />
    <col style="width: 23%" />
    <col style="width: 19%" />
    <col style="width: 19%" />
    <col style="width: 19%" />
    <tr>
        <td  align="left" colspan="5"><span class="color_red">*</span>总体概述：包括孵化器创办目的，投资人与运营机构资源优势，盈利模式、机构设置、人员构成、管理制度等（限600字）</td>
    </tr>
    <tr>
        <td colspan="5">
            <textarea name="proposal/general_overview" class="input_textarea required maxlength:600" label="总体概述" style="width: 98%" rows="9"><x:out select="$xmlData/data/proposal/general_overview" /></textarea>
            <input type="hidden" name="proposal/general_overview_hidden" value="<x:out select="$xmlData/data/proposal/general_overview_hidden" />"/>
        </td>
    </tr>
</table>



<script type="text/javascript">
    //创建节点
    var operation_subject4 = '<span><input type="text" label="其他" id="radio4" style="height: 17px;width: 145px;border: none;border-bottom: 1px solid gray;background-color: #f1f1f2;" maxlength="50" class="required" value="" onblur="setValByRadio4();" /></span>';
    var enterprise_type ='<span id="enterprise_type">' +
        '（<input type="radio" label="国有" id="stateEnterprise"  value="4" name="enterprise_type"  onblur="setValByRadio5()">国有' +
        '  <input type="radio" label="民营" id="privateEnterprise"  value="5" name="enterprise_type"  onblur="setValByRadio6()">民营）'+
        '</span>';


    //初始化radio  operation_subject_nature_other 选择其他时出现横线填写
    if($('input:radio[name="operation_subject_nature"]:checked').val()==3){
        $("input[name='operation_subject_nature']").parent().parent().parent().find('td').last('label').append(operation_subject4);
        var radio4_hidden = $("#operation_subject_nature_other").val();
        $("#radio4").val(radio4_hidden);
        $("#operation_subject_nature_other").addClass("required");
    }
    //初始化radio(企业) enterprise_type选择企业是出现的国有和民营
    if($('input:radio[name="operation_subject_nature"]:checked').val()==2){
        $("input[name='operation_subject_nature']").parent().parent().parent().find('td').has("label").eq(1).append(enterprise_type);
        var enterpriseTypeHidden =$("#enterprise_type_other").val();
        //当获取值隐藏值为4时，选中国有企业状态
        if(enterpriseTypeHidden==4){
            $("#stateEnterprise").attr('checked','true');
        }
        //当获取值隐藏值为5时，选中民营企业状态
        if(enterpriseTypeHidden==5){
            $("#privateEnterprise").attr('checked','true');
        }
        $("#enterprise_type_other").addClass("required");

    }

    //对radio须注明选项的值赋值给隐藏域 operation_subject_nature_other
    function setValByRadio4(){
        var radio4 = $("#radio4").val();
        $("#operation_subject_nature_other").val(radio4);
    }
    //对隐藏域 enterprise_type_other 进行赋值
    function setValByRadio5(){
        var radio5 = $("#stateEnterprise").val();
        $("#enterprise_type_other").val(radio5);
    }
    //对隐藏域 enterprise_type_other 进行赋值
    function setValByRadio6(){
        var radio6 = $("#privateEnterprise").val();
        $("#enterprise_type_other").val(radio6);
    }
    //当运营主体性质被其他选中，则显示输入框，被企业选中时，则显示单选框
    $("input[name='operation_subject_nature']").click(function(){
        var val=$('input:radio[name="operation_subject_nature"]:checked').val();
        //选中其他时的判断
        if(val==3){
            $(this).parent().parent().parent().find('span').remove();
            if($(this).parent().parent().parent().find('span').length<=0){
                $(this).parent().parent().parent().find('td').last('label').append(operation_subject4);
                $("#operation_subject_nature_other").addClass("required");
            }
        } else{
            $("#operation_subject_nature_other").removeClass("required");
            $("#operation_subject_nature_other").val("");
            $(this).parent().parent().parent().find('span').remove();
        }
        //选中企业时的状态赋值
        if(val==2){
            $(this).parent().parent().parent().find('span').remove();
            if($(this).parent().parent().parent().find('span').length<=0){
                $(this).parent().parent().parent().find('td').has("label").eq(1).append(enterprise_type);
                $("#enterprise_type_other").addClass("required");
            }
        }else {
            $("#enterprise_type_other").removeClass("required");
            $("#enterprise_type_other").val("");
        }
    });

function initTreeValueExt(treeId, treeNode) {
 	if ((treeNode && treeNode.isParent)) {
 		scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
 		$("#" + treeId).val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
 		return false;
 	}
 	var str = treeNode.name;
 	var obj = treeNode.parentNode;
 	while (obj != null) {
 		str = obj.name + "-" + str;
 		obj = obj.parentNode;
 	}
 	
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
}
</script>	